home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 1.toast / pc / sample code / files / asyncpb / asyncpb.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  2.1 KB  |  84 lines

  1. /*
  2.     File:        AsyncPB.h
  3.     
  4.     Description:AsyncPB is an example of how File System calls can be made 
  5.                 in a chain from an interrupt handler like the Time Manager.
  6.                 Once you select DoIt from the menu give it a little time to actually
  7.                 process the input file.
  8.  
  9.     Author:        JB
  10.  
  11.     Copyright:     Copyright: © 1984-1999 by Apple Computer, Inc.
  12.                 all rights reserved.
  13.     
  14.     Disclaimer:    You may incorporate this sample code into your applications without
  15.                 restriction, though the sample code has been provided "AS IS" and the
  16.                 responsibility for its operation is 100% yours.  However, what you are
  17.                 not permitted to do is to redistribute the source as "DSC Sample Code"
  18.                 after having made changes. If you're going to re-distribute the source,
  19.                 we require that you make it clear in the source that the code was
  20.                 descended from Apple Sample Code, but that you've made changes.
  21.     
  22.     Change History (most recent first):
  23.                 6/25/99    Updated for Metrowerks Codewarror Pro 2.1(KG)
  24.  
  25. */
  26. #define                isStationary            2048
  27.  
  28. #define                ApplicationMenuBar        128
  29. #define                AppleMenu                128
  30. #define                AboutItem                  1
  31. #define                FileMenu                129
  32. #define                DoIt                      1
  33. #define                QuitItem                  2
  34.  
  35. #define                AboutAlert                128
  36. #define                kWindowKind                'im'
  37.  
  38. void                DoMenu                    (short menu, short item);
  39. void                EventLoop                (void);
  40. int                    main                    (void);
  41.  
  42. typedef    struct MyParamBlockRec
  43. {
  44.     IOParam               ioParam;
  45.     
  46.     IOCompletionUPP       setFPosIOCompletion;
  47.     IOCompletionUPP       readIOCompletion;
  48.     IOCompletionUPP       writeIOCompletion;
  49.     
  50.     short               readFileRefNum;
  51.     short               writeFileRefNum;
  52.     
  53.     TMTaskPtr           tm;
  54.     
  55. } MyParamBlockRec, *MyParamBlockPtr;
  56.  
  57.  
  58.  
  59.  
  60. typedef    struct TaskRec
  61. {
  62.    TMTask           theTMTask;
  63.    MyParamBlockPtr    pb;
  64.     
  65. } MyTaskRec, *MyTaskPtr;
  66. #ifdef powerc
  67. pascal void PBReadIOCompletion(ParmBlkPtr parmblkptr);
  68. pascal void PBSetFPosIOCompletion(ParmBlkPtr parmblkptr);
  69. pascal void PBWriteIOCompletion(ParmBlkPtr parmblkptr);
  70. pascal void TMTaskProc(MyTaskPtr tm);
  71. #else
  72. pascal void PBReadIOCompletion();
  73. pascal void PBSetFPosIOCompletion();
  74. pascal void PBWriteIOCompletion();
  75. pascal void TMTaskProc();
  76. #endif
  77.  
  78.  
  79. MyTaskRec            gTM;
  80. MyParamBlockRec        gPB;
  81. char                gBuffer;
  82.  
  83.  
  84.